def serialize_device(device):
    """将设备对象转换为可序列化的字典（处理日期时间格式）"""
    return {
        "id": device.id,
        "name": device.name,
        "type": device.type,
        "status": device.status,
        "location": device.location,
    }